<?php
class Admin_Form_AddFaqs extends Apps_Form {
	public function init() {
	    $dataMaper = new M_Tool_DataMapper();
	    $tbFaqsCategory = new M_DbTable_FaqsCategory();

		$faqsCategoryId = new Zend_Form_Element_Select(
				'faqs_category_id',
				array('label' 		=> 'Faq category',
					  'required'	=> true,
				      'multiOptions'=> $dataMaper->mapKeyValue($tbFaqsCategory->getAllFaqsCategory(),'id', 'title')));

		$question = new Zend_Form_Element_Text(
				'question',
				array('label' 		=> 'Question (Vi)',
				      'class' => 'input-xxlarger'));

		$enQuestion = new Zend_Form_Element_Text(
				'en_question',
				array('label' 		=> 'Question (En)',
						'required'	=> true,
				      'class' => 'input-xxlarger'));

		$answer = new Zend_Form_Element_Textarea(
				'answer',
				array('label' 		=> 'Answer (Vi)'));

		$enAnswer = new Zend_Form_Element_Textarea(
				'en_answer',
				array('label' 		=> 'Answer (En)',
						'required'	=> true));

		$description = new Zend_Form_Element_Textarea(
				'description',
				array('label' => 'Description',
					  'rows'	=> 5,
					  'cols'	=> 80));

		$this->addElement($faqsCategoryId)
			 ->addElement($enQuestion)
		     ->addElement($question)
			 ->addElement($enAnswer)
			 ->addElement($answer)
			 ->addElement($description);

		$this->setLegend('Add New FAQS');
		$this->addActionGroup()
			 ->makeup();
	}
}